
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="<?php echo base_url();?>css/trangnoibo.css" type="text/css">
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/jquery.editable-1.3.3.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/js.js"></script>
<script>
<!-- edit(id_nguoidung,id_day,thoidiem,ngay,id_lich,noidung) --> 
	function edit(user_id,day_id,time,day_editing,id_lich,noidung){
		//alert(user_id+" "+day+" "+time);
		var inputbox = "<textarea class='inputbox' cols='8' rows='3'>"+$("."+user_id+day_id+time).text()+"</textarea>";
		
		//Insert the HTML into the div
		$("."+user_id+day_id+time).html(inputbox);
		
		//Immediately give the input box focus. The user
		//will be expecting to immediately type in the input box,
		//and we need to give them that ability
		$("textarea.inputbox").focus();
		
		//Once the input box loses focus, we need to replace the
		//input box with the current text inside of it.
		$("textarea.inputbox").blur(function() {
			//var value = $(this).val();
			//alert("user_id: "+user_id+"thoidiem: "+time+"noi dung: "+value+"ngay: "+day_editing);
			//$("."+user_id+day_id+time).text(value);
			if(id_lich != ""){ 
				$.ajax({
			        url: "<?php echo base_url()?>lichlamviec/sua_lich",
			        type:'POST',
			        data:{_id:id_lich, _content:noidung},
			        cache: false,
			        async: false,
			        dataType: 'json',
			        success: function(output_string){
			        	$("."+user_id+day_id+time).text(output_string);
			        	//$("."+user_id+day_id+time).html(output_string);
			        } // End of success function of ajax form
		        }); // End of ajax call
			}
			else
			{
				//$date,$user,$noidung,$thoidiem
				$.ajax({
			        url: "<?php echo base_url()?>lichlamviec/sua_lich",
			        type:'POST',
			        data:{_date:day_editing, _userid:user_id, _noidung:noidung, _thoidiem:time},
			        cache: false,
			        async: false,
			        dataType: 'json',
			        success: function(output_string){
			        		$("."+user_id+day_id+time).text(output_string);
			                //$(tag_div).html(output_string);
			            } // End of success function of ajax form
		        }); // End of ajax call
			}
			//alert("user_id: "+user_id+"thoidiem: "+time+"noi dung: "+value+"ngay: "+day_editing);
		});
	}
</script>
</head>
<body>
<div class="wraper">
<div class="banner">
</div>
<div class="menu">
<div class="menu_list">
<ul>
<li class="active_menu"><a href="#">Thông báo mới</a></li>
<li><a href="#">Lịch làm việc của lãnh đạo</a></li>
<li><a href="#">Lịch quay phim, xe ô tô</a></li>
<li><a href="#">Lịch kỹ thuật</a></li>
<li><a href="#">Lịch trường quay</a></li>
<li><a href="#">Lịch phòng họp ban</a></li>
<li><a href="#">Mẫu văn bản công văn </a></li>
</ul>
</div>
</div>